import React from 'react';
import ReactDOM from 'react-dom';
import Home from './Home';
import './index.css';
import * as serviceWorker from './serviceWorker';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/js/bootstrap';
import Login from './pages/Login';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import Register from './pages/Register';
import { UserShops, Shop } from './pages/customer/Shops';
import { EditReceiveInfo } from './pages/customer/EditReceiveInfo';
import { ConfirmOrder } from './pages/customer/ConfirmOrder'
import { OrderListPage } from './pages/OrderListPage'
import { OrderDetail } from './pages/customer/OrderDetail'
import { OrderComment } from './pages/customer/OrderComment'
import { BusinessShops, EditShop, EditCommodity, AddShop } from './pages/business/Shops'
import { OrdersPage } from './pages/business/Orders'
import { OrderPlaza, TakenOrders } from './pages/deliverer/Orders'
import { PosUpdate } from './pages/deliverer/PosUpdate';

// ReactDOM.render(<Home />, document.getElementById('root'));
ReactDOM.render((
    <Router>
        <Route exact path="/" component={Home}></Route>
        <Route path="/login" component={Login}></Route>
        <Route path="/register" component={Register}></Route>
        <Route path="/customer/shops" component={UserShops}></Route>
        <Route path="/customer/shop/:id" component={Shop}></Route>
        <Route path="/customer/receive_info" component={EditReceiveInfo}></Route>
        <Route path="/customer/confirm_order" component={ConfirmOrder}></Route>
        <Route path="/customer/orders" component={OrderListPage}></Route>
        <Route exact path="/customer/order/:id" component={OrderDetail}></Route>
        <Route path="/customer/order/comment/:id" component={OrderComment}></Route>

        <Route path="/business/shops" component={BusinessShops}></Route>
        <Route path="/business/shop/:id" component={EditShop}></Route>
        <Route path="/business/comm/:id" component={EditCommodity}></Route>
        <Route path="/business/addshop" component={AddShop}></Route>
        <Route path="/business/orders/:id" component={OrdersPage}></Route>

        <Route path="/deliverer/orderplaza" component={OrderPlaza}></Route>
        <Route path="/deliverer/orders" component={TakenOrders}></Route>
        <Route path="/deliverer/pos" component={PosUpdate}></Route>
    </Router>
), document.getElementById('root'));

serviceWorker.unregister();
